import request from '@/utils/request'

// 查询菜单流程配置列表
export function listWfMenuProcess(query) {
  return request({
    url: '/process/wfMenuProcess/list',
    method: 'get',
    params: query
  })
}

// 查询菜单流程配置列表
export function getWorkbenchList(query) {
  return request({
    url: '/process/wfMenuProcess/getWorkbenchList',
    method: 'get',
    params: query
  })
}

// 查询菜单流程配置详细
export function getWfMenuProcess(id) {
  return request({
    url: '/process/wfMenuProcess/' + id,
    method: 'get'
  })
}

// 保存菜单流程配置
export function saveWfMenuProcess(data) {
  return request({
    url: '/process/wfMenuProcess/save',
    method: 'post',
    data: data
  })
}

// 校验菜单标识是否重复
export function checkMenuKey(data) {
  return request({
    url: '/process/wfMenuProcess/checkMenuKey',
    method: 'post',
    data: data
  })
}

// 工作铺logo上传
export function uploadAvatar(data) {
  return request({
    url: '/process/wfMenuProcess/avatar',
    method: 'post',
    data: data
  })
}

// 删除菜单流程配置
export function delWfMenuProcess(id) {
  return request({
    url: '/process/wfMenuProcess/' + id,
    method: 'delete'
  })
}

// 根据菜单标识获取需要启动的流程 (默认值为自由流)
export function getProcessKey(menuKey) {
  return request({
    url: '/process/wfMenuProcess/getProcessKey/' + menuKey,
    method: 'get'
  })
}

// 根据菜单标识获取需要启动的流程 (没有默认值)
export function getMenuProcess(menuKey) {
  return request({
    url: '/process/wfMenuProcess/getMenuProcess/' + menuKey,
    method: 'get'
  })
}
